package script.functions

import com.tang.script.functions.ScriptFunction

@ScriptFunction(functionName = "合计")
static def sumList(List list) {
    if(list == null || list.isEmpty()) return 0
    BigDecimal res = 0
    for (final def a in list) {
        if(a == null || a == '') continue
        try {
            a = new BigDecimal(a + "");
            res += a
        } catch (Exception e) {}
    }
    return res
}